import request from '/@/utils/request';

// 查询商品规则值(规格)列表
export function listRule(query?: Object) {
  return request({
    url: '/module/product/rule/list',
    method: 'get',
    params: query
  })
}

// 查询商品规则值(规格)列表
export function listNoPage(ruleId) {
  if(ruleId  == undefined || ruleId == ''){
    ruleId = 0;
  }
  return request({
    url: '/module/product/rule/listNoPage/' + ruleId,
    method: 'get',
  })
}

// 查询商品规则值(规格)详细
export function getRule(id?: number) {
  return request({
    url: '/module/product/rule/' + id,
    method: 'get'
  })
}

// 新增商品规则值(规格)
export function addRule(data?: Object) {
  return request({
    url: '/module/product/rule',
    method: 'post',
    data: data
  })
}

// 修改商品规则值(规格)
export function updateRule(data?: Object) {
  return request({
    url: '/module/product/rule',
    method: 'put',
    data: data
  })
}

// 删除商品规则值(规格)
export function delRule(id?: number) {
  return request({
    url: '/module/product/rule/' + id,
    method: 'delete'
  })
}

// 导出商品规则值(规格)
export function exportRule(query?: Object) {
  return request({
    url: '/module/product/rule/export',
    method: 'get',
    params: query
  })
}
